package guda.house.dal.dao;

import guda.house.dal.dataobject.AdminDO;
import guda.grape.autogen.common.page.BaseQuery;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

public interface AdminDAO {


    Long insert(AdminDO admin);

    @Cacheable(value = "userCache", key="#adminId + 'getAdminById'")
    AdminDO getAdminById(Long adminId);

    @CacheEvict(value = "userCache", key="#adminId + 'getAdminById'")
    boolean delAdminById(Long adminId);

    List<AdminDO> getAdminByIds(List idsList);

    /**
     * 清空测试用例加入的autoincrement
     */
    void cleanAutoIncrement(Long adminId);

    List<AdminDO> selectForPage(BaseQuery baseQuery);

    int countForPage(BaseQuery baseQuery);
    @CacheEvict(value = "userCache", key="#admin.adminId + 'getAdminById'")
    void updateByIdSelective(AdminDO admin);

    AdminDO selectByUser(String username,String password);

}
